package com.entity;



import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


/**
 * ${comments}
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2019-12-05 14:43:16
 */
@Entity
@Data
@Table( uniqueConstraints = @UniqueConstraint(columnNames = {"id", "mail"}))
public class Users implements Serializable {
	private static final long serialVersionUID = 739668778715426461L;
	@Id
	@ApiModelProperty("主键")
	@TableId(value = "id", type = IdType.INPUT)
	@Column(columnDefinition = "varchar(32)")
	private String id;
	@ApiModelProperty("密码")
	@Column(columnDefinition = "varchar(32)")
	private String password;
	@ApiModelProperty("邮箱")
	@Column(columnDefinition = "varchar(32)")
	private String mail;
	@ApiModelProperty("昵称")
	@Column(columnDefinition = "varchar(32)")
	private String nickName;
	@TableField(fill = FieldFill.INSERT)
	@ApiModelProperty("创建时间")
	@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
	@Column(columnDefinition = "datetime")
	private Date crDate;
	@TableField(update = "getdate()")
	@ApiModelProperty("修改时间")
	@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
	@Column(columnDefinition = "datetime")
	private Date moDate;
	@ApiModelProperty("头像")
	@Column(columnDefinition = "text ")
	private String face;
	@ApiModelProperty("是否删除")
	@Column(columnDefinition = "varchar(10)")
	private String isAvailable;
	@ApiModelProperty("权限")
    private String power;
}
